<script>
// 按实际需要导入ElementPlus中的相关组件
import { 
  ElContainer, 
  ElHeader, 
  ElMain, 
  ElFooter, 
  ElAside, 
  ElMenu, 
  ElMenuItem
} from 'element-plus';
export default {
  name: 'root component',
  // 注册组件(局部注册)
  components: {
    ElContainer, 
    ElHeader, 
    ElMain, 
    ElFooter, 
    ElAside, 
    ElMenu, 
    ElMenuItem
  }
};
</script>

<template>
  <el-container>
    <el-header class="header">学生管理</el-header>
    <el-container>
      <el-aside class="navigator">
        <el-menu :router="true">
          <el-menu-item index="/student/list">学生列表</el-menu-item>
          <el-menu-item index="/student/add">添加学生</el-menu-item>
        </el-menu>
      </el-aside>
      <el-main class="main">
        <!--路由出口(即默认视图)-->
        <router-view></router-view>
      </el-main>
    </el-container>
    <el-footer class="footer">&copy;2022 开发喵</el-footer>
  </el-container>
</template>

<style scoped>
:global(body){
  padding: 0;
  margin: 0;
}
.header {
  height: 80px;
  line-height: 80px;
  font-size: 30px;
}
.navigator {
  min-height: 300px;
  background: #f4f4f4;
}
.navigator>* {
  margin: 10px ;
}
.main {
  background: #ffffee;
}
.footer {
  margin-top: 5px;
  height: 80px;
  line-height: 80px;
  text-align: center;
  background: #f8f8f8;
}
</style>
